package com.tul.exercise.base.innerclass.chapter10_8;

/**
 * @Description 《java编程思想》10.8
 *  闭包
 **/
public class Callbacks {
    public static void main(String[] args) {
        Callee1 c1 = new Callee1();
        Caller2 c2 = new Caller2();

        MyIncrement.f(c2);

        Caller caller1 = new Caller(c1);
        Caller caller2 = new Caller(c2.getCallbackReference());

        caller1.go();
        caller1.go();
        caller2.go();
        caller2.go();
    }
}
